const scanCode = function (params?: any) {
  return new Promise((resolve, reject) => {
    wx.scanCode({
      scanType: ["qrCode"],
      success(res) {
        let { result } = res
        let str = result.replace(/\ufeff/g, '')
        let dataObj = JSON.parse(str)
        resolve(dataObj);
      },
      fail(res) {
        reject(res)
      },
      complete() {

      }
    })
  })
}




export default { scanCode }